/*
 * @Author: huangximian huangximian@e-ling.com.cn
 * @Date: 2022-05-20 11:48:58
 * @LastEditors: huangximian huangximian@e-ling.com.cn
 * @LastEditTime: 2022-06-06 09:03:47
 * @FilePath: \jcyy-official-website\src\router\index.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

let flag = navigator.userAgent.match(
  /(phone|pad|pod|iPhone|iPod|ios|iPad|mobileTerminal|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
);
export const constantRoutes = [{
  path: '/',
  name: 'Home',
  component: (resolve) => require(["@/views/computerSide/home"], resolve),
  children: [{
      path: '/',
      name: 'homepage',
      meta: {
        biaoshi: '首页'
      },
      component: (resolve) => require(["@/views/computerSide/pages/Homeindex"], resolve)
    },
    {
      path: '/brandintroduction',
      name: 'brandintroduction',
      meta: {
        biaoshi: '关于槿椿'
      },
      component: (resolve) => require(["@/views/computerSide/pages/aboutHibiscusaltissima/brandintroduction"], resolve)
    },
    {
      path: '/rndustrialLayout',
      name: 'rndustrialLayout',
      meta: {
        biaoshi: '产业布局'
      },
      component: (resolve) => require(["@/views/computerSide/pages/isIndustrialLayout/rndustrialLayout"], resolve)
    },
    {
      path: '/hibiscusAltissima',
      name: 'hibiscusAltissima',
      meta: {
        biaoshi: '槿椿特色'
      },
      component: (resolve) => require(["@/views/computerSide/pages/featuresOfHibiscusAltissima/hibiscusAltissima"], resolve)
    },
    {
      path: '/jinchun',
      name: 'jinchun',
      meta: {
        biaoshi: '槿椿资讯'
      },
      component: (resolve) => require(["@/views/computerSide/pages/jinchunInformation/jinchun"], resolve)
    },
    {
      path: '/contactUstab',
      name: 'contactUstab',
      meta: {
        biaoshi: '联系我们'
      },
      component: (resolve) => require(["@/views/computerSide/pages/contactUs/contactUstab"], resolve)
    }
  ]
}]
export const constmobileTerminalRoutes = [{
  path: '/',
  name: 'Home',
  component: (resolve) => require(["@/views/mobileTerminal/Home"], resolve),
  children: [{
      path: '/',
      name: 'homePageindex',
      meta: {
        biaoshi: '首页'
      },
      component: (resolve) => require(["@/views/mobileTerminal/pages/homePage/homePageindex"], resolve)
    },
    {
      path: '/aboutJin',
      name: 'aboutJin',
      meta: {
        biaoshi: '关于槿椿'
      },
      component: (resolve) => require(["@/views/mobileTerminal/pages/aboutJinChun/aboutJin"], resolve)
    },
    {
      path: '/layout',
      name: 'layout',
      meta: {
        biaoshi: '产业布局'
      },
      component: (resolve) => require(["@/views/mobileTerminal/pages/lndustrialLayout/layout"], resolve)
    },
    {
      path: '/hibiscusindex',
      name: 'hibiscusindex',
      meta: {
        biaoshi: '槿椿特色'
      },
      component: (resolve) => require(["@/views/mobileTerminal/pages/hibiscusAilanthus/hibiscusindex"], resolve)
    },
    {
      path: '/jinchunindex',
      name: 'jinchunindex',
      meta: {
        biaoshi: '槿椿资讯'
      },
      component: (resolve) => require(["@/views/mobileTerminal/pages/Jinchuninformation/jinchunindex"], resolve)
    },
    {
      path: '/contactusindex',
      name: 'contactusindex',
      meta: {
        biaoshi: '联系我们'
      },
      component: (resolve) => require(["@/views/mobileTerminal/pages/contactus/contactusindex"], resolve)
    },
  ]
}]
console.log(constmobileTerminalRoutes)
export default new Router({
  mode: 'history', // 去掉url中的#
  routes: flag ? constmobileTerminalRoutes : constantRoutes
})
